<?php
/**
 * RepairhsdTaskMsgtpl报修计划任务发送消息
 * @author wxl
 */
class RepairhsdTaskMsgtpl extends BaseMsgtpl
{
	/**
	 * 计划任务下发送消息
	 * @param array $wechatInfo		微信信息
	 * @param array $orderInfo		订单信息
	 * @param array $templet		报修模版配置信息oOwnZtwrlReqnJ2h5mmqTh3LGxmc
	 */
	public function sendMsg($wechatInfo,$orderInfo,$templet,$openid)
	{
		$url = C('site_url').'/index.php?g=repairhsd&m=repairhsdReceive&a=index&repairId='.$orderInfo['repair_id'].'&order_id='.$orderInfo['order_id'];
		
		if($wechatInfo['account_id'] == 2){
			$this->wxTplSign = 'D3IHmxcLckGTHiXw-LDlApX9VIWdOvcZgVqyunmESjo';
		}elseif($wechatInfo['account_id'] == 5){
			$this->wxTplSign = '4EeswD5oYCEQJi2u8AOzAQrflX5aCQVxFOcr592-fvY';
		}elseif($wechatInfo['account_id'] == 6){
			$this->wxTplSign = 'y2OZQJsNL3wXLOrbTuXzuX2x5IVT_ZDsLodN3Mpzyug';
		}elseif($wechatInfo['account_id'] == 4){  //测试服
			$this->wxTplSign = 'k203JXlZ8F8SCYUIR3uH_HBL8Uq2aAMbAIv2N1r46ec';
		}elseif($wechatInfo['account_id'] == 10){  //铁道部
			$this->wxTplSign = 'RUdkrbYCT4fM8eYiEzMGoFrdj7tM2g9YI_Px4xaxETU';
		}elseif($wechatInfo['account_id'] == 28){
			$this->wxTplSign = '_hHj0eU1ZQ7yorFomzpQvFV21NxQj8S_bqolOO9sbBk';
		}elseif($this->wechatInfo['account_id'] == 3){
			$this->wxTplSign = 'Xip28HCL4EbvNB6bItDLrIheQnOceLI87-ZDE5f4m0A';
		}elseif($this->wechatInfo['account_id'] == 17){
				$this->wxTplSign = 'nr3BnPPtM-TA11B537yEf9_CRIV9KXbL9wn7lDJxWFg';
		}elseif($this->wechatInfo['account_id'] == 22){
			$this->wxTplSign = 'F-qFB-UE6XsmlvpM5liaOwXOLmuaTUosK7A_pz7im9o';
		}elseif($this->wechatInfo['account_id'] == 7){
			$this->wxTplSign = '44Z68YQ3QP5YtatYHElODM5iKzNBrNnI552eiY4drSE';
		}
		if($accountId == 22){
            	$info = array(
	                'first' => array("value" => '您有新的派单，请在您的维修广场查看！','color' => '#173177'),
	                'keyword1' => array("value" => $orderInfo['real_name'] ),
	                'keyword2' => array("value" => '' ),
	                'keyword3' => array("value" => '' ),
	                'keyword4' => array("value" => '' ),
	                'keyword5' => array("value" => date("Y-m-d H:i:s"),"color" => "#173177"),
	                'remark' => array("value" => "点击查看详情！","color" => "#173177"),
            	);
        }else{
			$info = array(
				'first' => array("value" => '您有新的派单，请在您的维修广场查看！', 'color' => '#173177'),
				'keyword1' => array("value" => $orderInfo['real_name']),
				'keyword2' => array("value" => date("Y-m-d H:i:s"), "color" => "#173177"),
				'keyword3' => array("value" => date("Y-m-d H:i:s", strtotime("+1 hour")), "color" => "#173177"),
				'remark' => array("value" => "您有订单未确认，请点击确认", "color" => "#173177")
			);
		}	

		$result = $this->wxObj->messageTpl($wechatInfo['appid'], $wechatInfo['appsecret'], $openid, $this->wxTplSign, $info, $url);
		return $result;
	}

}
